<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'offer-form',
	'enableAjaxValidation'=>false,
	'htmlOptions' =>array('enctype'=>'multipart/form-data'),
)); ?>

	<p class="note">Поля отмеченные здёздочкой (<span class="required">*</span>) должны быть обязательно заполненны.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'image'); ?>
		<?php
		$this->widget('admin.widgets.upload.imageUpload', array(
			'model' => $model,
			'field' => 'image',
			'allowDelete' => false,
		));
		?>
		<?php echo $form->error($model,'image'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'start'); ?>
		<?php
		$this->widget('admin.widgets.timepicker.timepicker', array(
			'model'=>$model,
			'name'=>'start',
			'options'=>array( 'value'=>date('Y-m-d H:i:s') ),
		));
		?>
		<?php echo $form->error($model,'start'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'finish'); ?>
		<?php
		$this->widget('admin.widgets.timepicker.timepicker', array(
			'model'=>$model,
			'name'=>'finish',
			'options'=>array( 'value'=>date('Y-m-d H:i:s') ),
		));
		?>
		<?php echo $form->error($model,'finish'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'sell_start'); ?>
		<?php
		$this->widget('admin.widgets.timepicker.timepicker', array(
			'model'=>$model,
			'name'=>'sell_start',
			'options'=>array( 'value'=>date('Y-m-d H:i:s') ),
		));
		?>
		<?php echo $form->error($model,'sell_start'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'sell_finish'); ?>
		<?php
		$this->widget('admin.widgets.timepicker.timepicker', array(
			'model'=>$model,
			'name'=>'sell_finish',
			'options'=>array( 'value'=>date('Y-m-d H:i:s') ),
		));
		?>
		<?php echo $form->error($model,'sell_finish'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'price'); ?>
		<?php echo $form->textField($model,'price'); ?>
		<?php echo $form->error($model,'price'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'discount'); ?>
		<?php echo $form->textField($model,'discount'); ?>
		<?php echo $form->error($model,'discount'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'terms'); ?>
		<?php
		$this->widget('ext.markitup.EMarkitUp', array(
			'model'=>$model,
			'name'=>'terms',
		));
		?>
		<?php echo $form->error($model,'terms'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php
		$this->widget('ext.markitup.EMarkitUp', array(
			'model'=>$model,
			'name'=>'description',
			'options'=>array(
				'data'=>array('preid'=>$model->preid),
				'imageUpload'=>true,
				'imageUploadUrl'=>CHtml::normalizeUrl(array('articles/uploadImage')),
			),
		));
		?>
		<?php echo $form->error($model,'description'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Добавить' : 'Сохранить'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->